Component({
  properties: {
    // 这里定义了innerText属性，属性值可以在组件使用时指定
  },
  data: {
    amount: 0,
    price: 2,
    priceAll: 0
  },
  observers:{
    'amount,price'(amount, price) {
      this.setData({
        priceAll: amount * price
      })
    }
  },
  methods: {
    change(e) {
      let amounts = e.detail.value
      this.setData({
        amount: amounts
      })
      console.log(this.data.amount,this.data.priceAll)
    }
  }
})
